#define _CRT_SECURE_NO_WARNINGS 1


#include <stdio.h>
int nums[6];
int sum = 0;
int input(){
    int n,f;
    char c;
    f=scanf("%d",&n);
    if(f==-1)
        return -1;
    else if(f==1)
        return n;
    else if(f==0){
        scanf(" %c",&c);
        switch(c){
            case 'A':  return 1;  break;
            case 'J':  return 10; break;
            case 'Q':  return 10; break;
            case 'K':  return 10; break;
            default :  return -1; break;
        }
    }
}
void func() {
    int flag = 0;
        for(int i = 0; i < 5; i++) {
            for(int j = 0; j < 5; j++) {
                for(int k = 0; k < 5; k++) {
                    if(i != j && j != k && i != k) {
                        int temp = nums[i] + nums[j] + nums[k];
                        if(temp % 10 == 0) {
                            flag = 1;
                            int t = sum - temp;
                            if(t % 10 == 0) {
                                printf("DOUBLE BULL\n");
                                return;
                            }else {
                                if(t % 10 == 0) {
                                    printf("NO BULL\n");
                                    return;
                                }else {
                                    printf("BULL %d\n", (t % 10));
                                    return;
                                }
                            }
                        }
                    }
                }
            }
        }
        if(flag == 0) {
            printf("NO BULL\n");
            return;
        }
}
int main() {
    while(1) {
        for(int i = 0; i < 5; i++) {
            int t = input();
            if(t == -1) {
                return 0;
            }else {
                nums[i] = t;
                sum += t;
            }
        }
        func();
        sum = 0;
    }
    return 0;
}